﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8">
		<title>Test Case 11: Disabled Form Fields in Template &laquo; Web Forms 2.0 Test Suite</title>
		<meta name="author" content="Weston Ruter">
		<meta name="description" content="">
		<script type="text/javascript" src="../webforms2-p.js"></script>
		<link rel="stylesheet" type="text/css" href="testcase.css"><!-- ISSUE: When this stylesheet is placed here after the script tag, MSIE sometimes cannot initialize Repetition Model before onload -->
		<!-- prev --><link rel="prev" href="010.html"><!-- /prev -->
		<!-- next --><link rel="next" href="012.html"><!-- /next -->
		<link rel="home" href="index.html">
		
		<style type="text/css">
		#nonsuccessfulTestResult {
		
		}
		#disabledTestResult {
		
		}
		
		span.passed .pretest,
		span.failed .pretest {
			display:none;
		}
		
		span .pass,
		span .fail {
			display:none;
		}
		
		span .pass {
			background-color:#99FF99;
		}
		span .fail {
			background-color:#FFCCCC;
		}
		
		span.passed .pass,
		span.failed .fail {
			display:inline;
			padding-left:1em;
			padding-right:1em;
		}
		</style>
		<script type="text/javascript">
		window.onload = function(){
			if(!window.location.href.match(/\?.+/)){
				document.forms[0].submit();
			}
			//disabledTestResult
			else {
				document.getElementById('disabledTestResult').className = window.location.href.match(/unsubmitted/) ? 'failed' : 'passed';
				document.getElementById('nonsuccessfulTestResult').className = window.location.href.match(/submitted%5Bi%5D/) ? 'failed' : 'passed';
			}
		}
		</script>
		
	</head>
	<body>
		<div id="testSuiteNote">

			<h1>Web Forms 2.0 Test Case 11: Disabled Form Fields in Template</h1>
			<p class="purpose">
			This test case demonstrates functionality of the Web Forms 2.0 specification and tests the compliance of 
			this cross-browser <a href="http://code.google.com/p/webforms2/">Web Forms 2.0 implementation</a>.</p>

			 <p>The following verifies that form fields within a repetition template are not successful. It also tests whether form fields disabled in the repetition template are also disabled in each instantiated repetition block, but note: for this to work in this implementation, authors must include a class name of "disabled" on all disabled elements in the repetition template element to ensure that they are also disabled in each repetition block. This is due to an issue in Firefox which is detailed in issue <a href="http://code.google.com/p/repetitionmodel/issues/detail?id=9">#9</a>.</p> 
			
			<div class="testSuiteNavigation">
				<!-- prev -->&larr;&nbsp;<a href="010.html" class="prev">Orphan Repetition Blocks</a> |<!-- /prev -->
				<a href="index.html" class="index">Test Suite Index</a>
				<!-- next -->| <a href="012.html" class="next">repeat-min, repeat-max, and repeat-start attributes</a>&nbsp;&rarr;<!-- /next -->
			</div>
			
			<hr>
		</div>
  


		
				
		<form method="get">
			<ol>
				<li repeat="template" id="i">
					Not disabled element: <input type="text" name="submitted[i]" value="submitted" /><br />
					Disabled element: <input type="text" name="unsubmitted[i]" value="not submitted" disabled="disabled" class="disabled" /> <em><small>(this should not be successful in form submission)</small></em>
				</li>
			</ol>
			<button type="add" template="i">Add block</button> 
			<button type="submit"><strong>Submit form</strong></button>
		</form>
		
		<h2>Test results</h2>
		<ol>
			<li><p>Form fields in repetition template should not be 'successful' (there should not be any querystring parameters with keys such as <code>submitted[i]</code>; these fields should not be submitted): 
			<span id="nonsuccessfulTestResult">
				<span class='pretest'>Press 'submit form' to test...</span>
				<span class="pass">Passed</span>
				<span class="fail">Failed!</span>
			</span>
			</p></li>
			
			<li><p>Form fields in the repetition template which are originally flagged as <code>disabled</code> should be disabled in each instantiated repetition block:
			<span id="disabledTestResult">
				<span class='pretest'>Press 'submit form' to test...</span>
				<span class="pass">Passed</span>
				<span class="fail">Failed!</span>
			</span>
			</p></li>
		</ol>
		

		<hr>
		<a href="http://code.google.com/p/webforms2/">Web Forms 2.0 implementation</a><br>
		Version: 0.5.2 (2007-11-29) <a href="http://code.google.com/p/webforms2/wiki/Changelog">changelog</a>
		<address>
		<a href="http://weston.ruter.net/">Weston Ruter</a>
		</address>
	</body>
</html>